function createStar() {
    const star = document.createElement('div');
    star.classList.add('star');
    star.style.top = `0vh`;
    star.style.left = `${Math.random() * 100}vw`;
    document.body.appendChild(star);

    setTimeout(() => {
        document.body.removeChild(star);
    }, Math.random() * 5000); // 随机时间间隔
}

function generateRandomStars() {
    createStar();
    setTimeout(generateRandomStars, Math.random() * 5000); // 随机时间间隔
}

generateRandomStars();
//引入star.css
var linkElement = document.createElement("link");
linkElement.rel = "stylesheet";
linkElement.href = "/css/tx/star.css";
document.head.appendChild(linkElement);